<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            display: flex;
            width: 800px;
            height: 400px;
            background-color: greenyellow;
            /* 1.默认的主轴是 x 轴 row */
            /* 2.主轴为y轴 */
            flex-direction: column;
            justify-content: center;
            /* 需要一个侧轴居中 */
            align-items: center;
            /* 拉伸，但子盒子不要给高度 */
            /* align-items: stretch; */
        }
        
        div span {
            width: 150px;
            height: 100px;
            background-color: red;
            color: #fff;
            margin: 10px;
        }
    </style>

</head>

<body>
    <div>
        <!-- 盒子水平垂直居中 -->
        <span>1</span>
        <span>2</span>
        <span>3</span>
    </div>
</body>

</html>